package com.room.search.response;

/**
 * By   : ghd.bright
 * Time : 2022/1/26
 * Description: 舍取统一的返回体
 */
public class RoomResponse {
    private Integer code;
    private String msg;
    private Object data;

    public RoomResponse(Integer code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public RoomResponse(String msg, Object data) {
        this.msg = msg;
        this.data = data;
    }

    public static RoomResponse success(String msg,Object data) {
        return new RoomResponse(1, msg, data);
    }


    public static RoomResponse fail(String msg,Object data) {
        return new RoomResponse(0, msg, data);
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
